package com.hxd.otc.common.enums;

public enum ExValidType {
    /**
     * "1"：谷歌验证；"3"：短信验证；"4":"邮箱验证"，其他："用户还没有设置"
     */
    GoogleAuth("1", "谷歌验证"), SMS("3", "短信验证"), Email("4", "邮箱验证"), Other("", "未设置");

    private final String validType;
    private final String desc;

    ExValidType(String validType, String desc) {
        this.validType = validType;
        this.desc = desc;
    }

    public String getValidType() {
        return validType;
    }

    public String getDesc() {
        return desc;
    }

    public static ExValidType getInstanceByType(String validType) {
        if (GoogleAuth.validType.equals(validType)) {
            return GoogleAuth;
        } else if (SMS.validType.equals(validType)) {
            return SMS;
        } else if (Email.validType.equals(validType)) {
            return Email;
        } else {
            return Other;
        }
    }
}
